const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    pro: [{
        images: "./image/icon1.gif",
        text: "积分",
        data: 0,
      },
      {
        images: "./image/icon2.gif",
        text: "优惠卷",
        data: 0
      },
      {
        images: "./image/icon3.gif",
        text: "余额",
        data: 0
      },
    ],
    order: [{
        icon: {
          name: 'friend',
          isShow: true
        },
        text: "食堂/外卖"
      },
      {
        icon: {
          name: 'newshot',
          isShow: true
        },
        text: "买单订单"
      },
      {
        icon: {
          name: 'news',
          isShow: true
        },
        text: "食堂/外卖"
      },
      {
        icon: {
          name: 'peoplelist',
          isShow: true
        },
        text: "储值订单"
      }
    ],
    function: [{
        icon: {
          name: 'home',
          isShow: true
        },
        text: "我的地址"
      },
      {
        icon: {
          name: 'phone',
          isShow: true
        },
        text: "联系客服"
      },
      {
        icon: {
          name: 'news',
          isShow: true
        },
        text: "完善资料"
      },
      {
        icon: {
          name: 'evaluate',
          isShow: true
        },
        text: "礼品卡"
      }
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setMoney(); // 钱数获取
  },
  setMoney() {
    let data = "pro[2].data"
    this.setData({
      [data]: app.globalData.user.money
    })
  },
  func(data) {
    let site = data.currentTarget.dataset.a
    if (site == "我的地址") {
      wx.reLaunch({
        url: '../mySite/index?datas=my/index',
      })
    }
  }
})